Skip to content

[0.4.x] lv-tool: Debounce resize requests (fixes #161) - #249

Merged
hartwork merged 3 commits into
0.4.xfrom
0.4.x-lv-tool-debounce-resize-requests
Feb 4, 2023
Merged

hartwork merged 3 commits into
0.4.xfrom
0.4.x-lv-tool-debounce-resize-requests

Conversation

@hartwork

@hartwork hartwork commented Feb 4, 2023

Copy link
Copy Markdown
Member

Fixes #161

Started out at hartwork/sdl_video_demo#10

@hartwork hartwork added this to the 0.4.2 milestone Feb 4, 2023
@hartwork
hartwork requested a review from kaixiong February 4, 2023 03:04
@hartwork hartwork linked an issue Feb 4, 2023 that may be closed by this pull request
Time operator-(Time const& other) const {
return Time(this->m_moment - other.m_moment);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the reason to implement the subtraction operator as a member function? The implementation in master uses a free function, following the practice of the C++ standard library.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kaixiong no particular reason, changed now as suggested.

return false;
}
const double seconds_passed = (LV::Time::now() - m_received_at).to_usecs() / 1000.0 / 1000.0;
return seconds_passed >= 0.2; // >=300ms is known to feel slow to humans

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to backport LV::Time::to_secs() and use that instead.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kaixiong good idea, done

@hartwork
hartwork force-pushed the 0.4.x-lv-tool-debounce-resize-requests branch from 634792b to bf0abd1 Compare February 4, 2023 22:13

@kaixiong kaixiong left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few formatting inconsistencies against lv-tool in master which I think could be resolved to ease porting between the branches. Another enhancement to consider is having a configurable debounce period.

Other than the above, I think the implementation looks good and could be merged first.

@hartwork
hartwork merged commit b1744d9 into 0.4.x Feb 4, 2023
@hartwork
hartwork deleted the 0.4.x-lv-tool-debounce-resize-requests branch February 4, 2023 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Erratic resizing of lv-tool window under GNOME Shell

2 participants